Measure sustainability, and fix the layout shift on page load (#101) #102
+53
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #101
What
maina minimum height of one screen (AppLayout.module.css), so the footer starts below the fold.Why
Lighthouse (mobile) on the VM gave performance 78, and the main reason was Cumulative Layout Shift: 0.356, where under 0.1 is good. While a page's code loaded, only «Laster …» was in
main, so the footer sat high up and was pushed down when the page came. Lighthouse named the footer as the cause of 0.340 of it.Numbers
JavaScript is still over its budget. Two findings for later: the API's JSON responses are not compressed, and the built files have no
Cache-Controlheader. Both are one line each in Apache, and are added to «Plan ahead».How to test
npm run build && npm run previewinfrontend/, with the backend running./project2/and/project2/sok: CLS should be under 0.1./project2/finnesikke: the footer should be below the fold, and the page should look normal on desktop and mobile.npm run checkpasses.The CLS numbers after the fix are measured locally. We measure on the VM again after merge and deploy.
(^Numbers above is helped and generated by Claude^)